package com.ryskoo.common.constant;

/**
 * 分账结算状态
 *
 * @author Monster
 */
public enum SplitStatusEnum {
    TOACCOUNT(1, "待分账"),
    ACCOUNTED(2, "已分账"),
    BALANCE(3, "已结算"),
    SUCCESS(4, "结算成功");
    private int value;
    private String name;

    SplitStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(int value) {
        for (SplitStatusEnum o : SplitStatusEnum.values()) {
            if (o.getValue() == value) {
                return o.getName();
            }
        }
        return "";
    }
}
